<template>
  <div class="echartTools">
    <div class="echartTools-views" ref="echartTools-views"></div>
    <div class="echartTools-tools">
      <tool @initLoadOptions="initLoadOptions" />
    </div>
  </div>
</template>

<script>
import InitE from "./tools/initE";
import tool from "./rightTools/tool.vue";
export default {
  provide() {
    return {
      slef: this,
    };
  },
  components: { tool },
  data() {
    return {
      inite: null,
      echartWatchTimer: null,
    };
  },
  methods: {
    initLoadOptions(options) {
      this.inite.initLoadOptions(options);
    },
  },
  async mounted() {
    this.inite = new InitE({
      el: this.$refs["echartTools-views"],
      eventHooks: {
        click(model) {
          console.log(model);
        },
        dbClick(model) {
          console.log(model);
        },
        mouseover(model) {
          // console.log(model);
        },
      },
    });
  },
};
</script>

<style lang="scss" scoped>
.echartTools {
  width: 100%;
  height: 100%;
  display: flex;
  &-views {
    flex: 3;
    height: 100%;
    border-right: 1px solid #888;
  }
  &-tools {
    flex: 1;
    height: 100%;
  }
}
</style>